<h1>Dobrodošlica</h1>


<div class="box nopadding border1">

    <div class="qoptions qoptionssmlpadding clearfix" style="border-top: 0;"> 
        <div class="right">
            <a href="<?=base_url()?>article/article/new_form" class="btn">Kreirajte novi članak</a>
        </div>
    </div>

    <table cellspacing="0" cellpadding="0" class="folder-table">
    <tbody>
    <tr>
    <td style="border-right: 1px solid #CCCBCA; vertical-align: top;">
        <!--<div style="height: 520px;">-->


        <div id="list">
            <ul>
                <?
                    foreach($article as $row){

                    ?>
                    <li id="<?=$row['article_id']?>" class="clearfix">

                        <? $format = "%d.%m - %H:%i".' h'; ?>
                        <!--<div class="art_date">Kreiran <? echo mdate($format, $row['datepublish'])?></div>-->

                        <a class="art_li" href="javascript:">

                            <?
                                $status = '';
                                switch($row['article_status']){
                                    case 0: $status = 'closed'; break;
                                    case 1: $status = 'closed'; break;
                                    case 2: $status = 'closed'; break;
                                    case 3: $status = 'closed'; break;
                                    case 4: $status = 'open'; break;
                                }
                            ?>
                            <span class="art_status <?=$status;?>"></span>
                            <?=$row['article_title']?> 
                        </a>

                    </li>
                    <?
                    }
                ?>

            </ul>
        </div>


    </td>
    <td id="minireport">

        <?
            foreach($article as $row){
                $title = $row['article_title'];
                $uptitle = $row['article_uptitle'];
                $intro = $row['article_intro'];

                $status = '';
                switch($row['article_status']){
                    case 0: $status = 'Kreiran u bazi'; break;
                    case 1: $status = 'Čeka na lektora'; break;
                    case 2: $status = 'Pregledan od lektora'; break;
                    case 3: $status = 'Odobren od urednika'; break;
                    case 4: $status = 'Aktivan';  break;
                }
                $text = $row['article_text'];
                $filepath = $row['media_filepath'];
                $media_type = $row['media_type'];
                break;
            }
        ?>


        <div id="mheader" class="clearfix">


            <div id="mini-meta-container">
                <div class="mini-meta">
                    <small>Status</small>
                    <div id="drop-hover">
                        <span id="main-status">
                            <?=$status;?>                                    
                        </span>
                    </div>
                </div>
            </div>

            <div class="preview" style="float: none;">

                <div class="art_intro">

                    <div class="text">

                        <h2><?=$uptitle;?></h2>

                        <h1><?=$title;?></h1>

                        <p><?=$intro;?></p>

                    </div>

                </div>

            </div>

            <ul class="navcontrol nopadding right mini-meta-tabs">
                <li><a href="#" class="link-edit side-left">Nad naslov</a></li>
                <li class="space">&nbsp;</li>
                <li><a id="2" href="javascript:" class="link-edit embeded-code">Naslov</a></li>
                <li class="space">&nbsp;</li>
                <li><a id="2" href="javascript:" class="link-edit embeded-code">Uvod</a></li>
                <li class="space">&nbsp;</li>
                <li><a id="2" href="javascript:" class="link-edit embeded-code">Slika</a></li>
                <li class="space">&nbsp;</li>
                <li><a href="#" class="link-edit side-right">Tekst</a></li>
            </ul>
        </div>



        <div id="mini-report-body">

            <div class="preview" style="float: none; margin-top:20px ;">


                <?
                    $folder = '';
                    if($media_type=='img'){
                        $folder='img';
                    }else if($media_type=='video'){
                            $folder='videos';
                        }
                ?>

                <div class="img" style="margin-bottom: 20px;"><img src="<?=base_url()?>assets/mediagallery/<?=$folder?>/<?=$filepath;?>" /></div>

                <div class="art_cont">

                    <div class="column">

                        <?=$text;?>

                    </div>

                </div>
            </div>

            <div>
                <h2>Opcije članka</h2>
                <ul class="navcontrol nopadding">
                    <li>  
                        <a style="display: none;" id="2" href="javascript:void(0)" class="side-left link-refresh toggle-item closed open-poll">Otvori</a>
                        <a id="2" href="javascript:" class="side-left link-refresh toggle-item open close-poll">Zatvori</a>
                    </li>
                    <li class="space">&nbsp;</li>
                    <li><a id="2" href="javascript:" class="link-delete delete-item side-right delete-poll">Obriši</a></li>
                </ul>
            </div>
        </div>

    </td>



</div>
